import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import '../data/sign_type.dart';


class SignTypeItem extends StatelessWidget {
  final SignInfo mSignInfo;

  const SignTypeItem(this.mSignInfo, {super.key});

  @override
  Widget build(BuildContext context) {
    SignInfoModel signInfoModel = Provider.of<SignInfoModel>(
        context, listen: true);
    return DecoratedBox(
        decoration: const BoxDecoration(color: Colors.lightBlue),
        child: ListTile(
          leading: Radio<SignInfo>(
              value: mSignInfo,
              groupValue: signInfoModel.currentSignInfo,
              onChanged: (SignInfo? value) {
                signInfoModel.currentSignInfo = value;
              }),
          title: Text(mSignInfo.typeName),
          subtitle: Text(mSignInfo.typeInfo),
          selectedColor: Colors.deepPurple,
        )
    );
  }
}
